<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <!-- 表单头部 -->
                <div class="box-header with-border">
                    <div class="btn-group">
                        <a class="btn flat btn-sm btn-default BackButton">
                            <i class="fa fa-arrow-left"></i>
                            返回
                        </a>
                    </div>
                    <h2>新增高级院校：</h2>
                </div>
                <form id="dataForm" class="form-horizontal dataForm" action="/admin/university/create"
                      method="post"
                      enctype="multipart/form-data">
                    <div class="box-body">
                        <div class="form-group">
                            <label for="title" class="col-sm-2 control-label">名称（全称）</label>
                            <div class="col-sm-10 col-md-4">
                                <input maxlength="50" class="form-control" id="title" placeholder="请填写学校名称在此处"
                                       name="name" value="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="personInCharge" class="col-sm-2 control-label">编号</label>
                            <div class="col-sm-10 col-md-3">
                                <input maxlength="50" type="number" class="form-control" id="personInCharge"
                                       placeholder="请在此处填写学校编号"
                                       name="code" value="">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="avatar" class="col-sm-2 control-label">校徽</label>
                        <div class="col-sm-10 col-md-4">
                            <input id="avatar" name="badge" placeholder="请上传校徽图标" type="file"
                                   class="form-control field-image">
                        </div>
                    </div>
                    <script>
                        $('#avatar').fileinput({
                            language: 'zh',
                            overwriteInitial: true,
                            browseLabel: '浏览',
                            initialPreviewAsData: true,
                            dropZoneEnabled: true,
                            showUpload: false,
                            showRemove: false,
                            allowedFileTypes: ['image'],
                            maxFileSize: 10240,
                        });
                    </script>

                    <!--表单底部-->
                    <div class="box-footer">
                        <div class="col-sm-2">
                        </div>
                        <div class="col-sm-10 col-md-4">
                            <div class="btn-group pull-right">
                                <label class="createContinue">
                                    <input type="checkbox" value="1" id="_create" name="_create"
                                           title="继续添加数据">继续添加</label>
                            </div>
                            <div class="btn-group">
                                <button type="submit" class="btn flat btn-info dataFormSubmit">
                                    保存
                                </button>
                            </div>
                            <div class="btn-group">
                                <button type="reset" class="btn flat btn-default dataFormReset">
                                    重置
                                </button>
                            </div>
                        </div>
                    </div>

                </form>
            </div>
        </div>
    </div>

</section>

<script>
    $("#dataForm").validate({
        rules: {
            nickname: {
                required: true,
                minlength: 2
            },
            username: {
                required: true,
                minlength: 2
            },
            password: {
                required: true,
                minlength: 6
            },
        },
        messages: {
            nickname: {
                required: "请输入昵称",
                minlength: "名称长度不能小于2"
            },
            username: {
                required: "请输入账号",
                minlength: "用户名长度不能小于2"
            },
            password: {
                required: "请输入密码",
                minlength: "密码长度不能小于6"
            },
        },

    });
</script>

